﻿using BCEntity.TMS.MarketingCoupon.MarketingCouponAddress;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.MarketingCoupon.MarketingCouponAddress
{
    public interface IMarketingCouponAddressData
    {
        /// <summary>
        /// 根据id删除
        /// </summary>
        /// <param name="marketingCouponAddressId"></param>
        /// <returns></returns>
        Task<int> DeleteAsync(long marketingCouponAddressId);
        /// <summary>
        /// 根据类型id删除
        /// </summary>
        /// <param name="marketingCouponTypeId"></param>
        /// <returns></returns>
        Task<int> DeleteByTypeId(long marketingCouponTypeId);
        /// <summary>
        /// 根据id获取数据
        /// </summary>
        /// <param name="marketingCouponAddressId"></param>
        /// <returns></returns>
        Task<MarketingCouponAddressEntity> GetEntityAsync(long marketingCouponAddressId);
        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<MarketingCouponAddressEntity>, int)> GetListAsync(int pageIndex, int pageSize);
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="marketingCouponTypeId"></param>
        /// <returns></returns>
        Task<IEnumerable<MarketingCouponAddressViewEntity>> GetListViewAsync(long marketingCouponTypeId);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<MarketingCouponAddressEntity> InsertAsync(MarketingCouponAddressEntity entity);
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<MarketingCouponAddressEntity> UpdateAsync(MarketingCouponAddressEntity entity);
        /// <summary>
        /// 添加列表
        /// </summary>
        /// <param name="entities"></param>
        /// <returns></returns>
        Task<int> InsertAllAsync(IEnumerable<MarketingCouponAddressEntity> entities);
        /// <summary>
        /// 获取所有的地区名称
        /// </summary>
        /// <param name="marketingCouponTypeId">优惠券类型id</param>
        /// <returns></returns>
        Task<string> GetAddressStrByTypeId(long marketingCouponTypeId);
    }
}